<template>
  <div>
    <el-form ref="form" :model="form" :rules="rules" :inline="true" label-width="120px" style="padding-top: 20px">
      <el-form-item label="灾备模式" prop="backupMode">
        <el-radio-group v-model="form.backupMode" style="width: 300px">
          <el-radio label="complete">全量冷备</el-radio>
          <el-radio label="increment">增量冷备</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="增量周期" v-if="form.backupMode === 'increment'" prop="incrementTime">
        <el-select v-model="form.incrementTime" placeholder="请选择增量周期" style="width: 300px">
          <el-option label="昨天" value="yesterday" />
          <el-option label="最近一周" value="lastWeek" />
          <el-option label="最近一月" value="lastMonth" />
          <el-option label="最近三月" value="lastThreeMonths" />
          <el-option label="最近半年" value="lastSixMonths" />
        </el-select>
      </el-form-item>
      <el-form-item label="备份文件限制" prop="backupFileRestrictions">
        <el-radio-group v-model="form.backupFileRestrictions" style="width: 300px">
          <el-radio label="allTable">所有表</el-radio>
          <el-radio label="timePartitionTable">无时间分区表</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="保留次数" prop="backupNumber">
        <el-input clearable size="small" style="width: 300px" placeholder="请输入执行周期" v-model="form.backupNumber"/>
      </el-form-item>
      <el-form-item label="执行方式" prop="executionMode">
        <el-radio-group v-model="form.executionMode" style="width: 300px">
          <el-radio label="hand">手动执行</el-radio>
          <el-radio label="scheduled">自动执行</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="执行周期" v-if="form.executionMode === 'scheduled'" prop="executionCron">
        <el-input clearable size="small" style="width: 300px" placeholder="请输入执行周期" v-model="form.executionCron"/>
      </el-form-item>
      <el-form-item label="未来执行时间" v-if="form.executionMode === 'scheduled'" prop="executionTime">
        <el-input clearable type="textarea" style="width: 300px" disabled :rows="3" size="small" placeholder="请等待自动生成"
                  v-model="form.executionTime"/>
      </el-form-item>
      <el-form-item label="时间分区字段" v-if="form.backupMode === 'increment'" prop="executionTime">
        <el-input clearable type="textarea" style="width: 300px" :rows="3" size="small" placeholder="清输入时间分区字段"
                  v-model="form.executionTime"/>
      </el-form-item>
    </el-form>
    <div class="dialog-footer" style="width:100%;text-align: center;padding-top: 10px">
      <el-button type="primary" @click="">保 存</el-button>
      <el-button type="primary" @click="">备 份</el-button>
    </div>
  </div>
</template>

<script>

export default {
  name: 'DisasterRecoveryConf',
  data() {
    return {
      form: {
        executionMode: 'scheduled',
        executionCron: null,
        executionTime: null,
        backupMode: 'increment',
        incrementTime: 'lastThreeMonths',
        backupFileRestrictions: 'timePartitionTable'
      },
      rules: {}
    }
  },
  created() {
  },
  methods: {}
}
</script>
<style scoped>

</style>
